import axios from "../index.js";

// 查询所有字典分页集合
export const dictionaryList = (data) => {
  return axios.request({
    url: "/system/dicType/doPageList",
    method: "post",
    data: data
  });
};

// 查询所有字典集合 不分页
export const dictionaryDoList = (data) => {
  return axios.request({
    url: "/system/dicType/doList",
    method: "post",
    data: data
  });
};

// 字典新增
export const dictionaryAdd = (data) => {
  return axios.request({
    url: "/system/dicType/save",
    method: "post",
    data: data
  });
};


// 字典修改
export const dictionaryEdit = (data) => {
  return axios.request({
    url: "/system/dicType/doUpdById",
    method: "post",
    data: data
  });
};

// 字典详情
export const dictionaryDetails = (data) => {
  return axios.request({
    url: "/system/dicType/getById",
    method: "get",
    data: data
  });
};


// 字典删除
export const dictionaryDelete = (data) => {
  return axios.request({
    url: "/system/dicType/doDelete",
    method: "get",
    data: data
  });
};


// 查询字典下的类型
export const dictionaryType = (data) => {
  return axios.request({
    url: "/system/dic/doPageList",
    method: "post",
    data: data
  });
};

// 查询字典下的类型 不分页
export const dictionaryTypeList = (data) => {
  return axios.request({
    url: "/system/dic/doAllList",
    method: "post",
    data: data
  });
};


// 字典下的类型新增
export const dictionaryTypeAdd = (data) => {
  return axios.request({
    url: "/system/dic/save",
    method: "post",
    data: data
  });
};

// 字典下的类型级联新增
export const doSaveCascade = (data) => {
  return axios.request({
    url: "/system/dic/doSaveCascade",
    method: "post",
    data: data
  });
};

// 字典下的类型x修改
export const dictionaryTypeUpdate = (data) => {
  return axios.request({
    url: "/system/dic/doUpdById",
    method: "post",
    data: data
  });
};

// 字典下的类型级联修改
export const doUpdateCascade = (data) => {
  return axios.request({
    url: "/system/dic/doUpdateCascade",
    method: "post",
    data: data
  });
};

// 字典下的类型删除
export const dictionaryTypeDelete = (id) => {
  return axios.request({
    url: `/system/dic/doDelete?id=${id}`,
    method: "get"
  });
};
